﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Demo01
{
    class Hero:Person
    {
        public Hero()
        {
        }

        public Hero(string name) : base(name)
        {

        }
        public void HeroCreate()
        {
            while (true)
            {
                Console.WriteLine("请选择对方角色<1.刘备 2.孙权 3.曹操>");
                Console.Write("请选择：");
                string chioce = Console.ReadLine();
                switch (chioce)
                {
                    case "1":
                        this.Name = "刘备";
                        return;
                    case "2":
                        this.Name = "孙权";
                        return;
                    case "3":
                        this.Name = "曹操";
                        return;
                    default:
                        Console.WriteLine("选择错误，请重新输入");
                        continue;
                }
            }
        }

        public override string Action()
        {
            Random rd = new Random();
            int num = rd.Next(1, 4);
            switch (num)
            {
                case 1:
                    return "剪刀";
                case 2:
                    return "石头";
                case 3:
                    return "布";
            }
            return "";
        }
    }
}
